#include <iostream>
#include <string>
#include <vector>
#include <functional>

void print(const std::string &str, int num)
{
    std::cout << str << num << std::endl;
}

int main()
{
    using Task = std::function<void()>;
    std::vector<Task> arry;
    arry.push_back(std::bind(print, "hello", 10));
    arry.push_back(std::bind(print, "xiaowei", 20));
    arry.push_back(std::bind(print, "nihao", 30));
    arry.push_back(std::bind(print, "qingfeng", 40));

    for (auto &f : arry)
    {
        f();
    }
    
    auto func1 = std::bind(print, "测试2.", std::placeholders::_1);
    auto func2 = std::bind(print, std::placeholders::_1, std::placeholders::_2);

    func1(1);
    func2("测试2.",2);

    return 0;
}